<?php namespace Cribbb\Storage;
 
use Illuminate\Support\ServiceProvider;

/**
 * Service Providers are just like bootstrap classes that allow you to set things up in a certain way.
 */
class StorageServiceProvider extends ServiceProvider {
 
	/**
	 * The register method is automatically called on the Service Provider. 
	 * This allows you to bootstrap your files so everything is loaded correctly.
	 * @see \Illuminate\Support\ServiceProvider::register()
	 */
  	public function register()
  	{
  		// Binding the User Repository to the Eloquent User Repository
  		// This means, whenever I want to use the User Repository, Laravel will automatically know that I want to use the Eloquent User Repository
  		// If in the future I wanted to use Mongo instead, I would simply have to create a Mongo User Repository and update this binding.
  		$this->app->bind(
      		'Cribbb\Storage\Nerd\NerdRepository',
      		'Cribbb\Storage\Nerd\EloquentNerdRepository'
    	);
  	}
 
}